// 导入需要的config和request
import confing from '../config/config.js';
import request from '../util/request.js';
// 申明请求对象
const oqcRequst = {
    BASE_URL: confing.QC_URL + "/oqc",
  

    // 请求的API
    list(page = 1, limit = 10, oqc, callbcak) {
        // url
        let url = this.BASE_URL + "/list?page=" + page +
            "&limit=" + limit;
        if (oqc) {
            if (oqc.oqcCode) {
                url += "&oqcCode=" + oqc.oqcCode;
            }
            if (oqc.clientName) {
                url += "&clientName=" + oqc.clientName;
            }
            if (oqc.batchCode) {
                url += "&batchCode=" + oqc.batchCode;
            }
            if (oqc.itemCode) {
                url += "&itemCode=" + oqc.itemCode;
            }
            if (oqc.itemName) {
                url += "&itemName=" + oqc.itemName;
            }
            if (oqc.checkResult) {
                url += "&checkResult=" + oqc.checkResult;
            }
        }
        // 发送请求
        request.get(url, callbcak);
    }

}

// 将dictRequest暴漏出去
export default oqcRequst;